// 创建场景
let scene = new THREE.Scene();

// 创建摄像头
let camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.lookAt(0, 0, 0)
let renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
let geometry = new THREE.BoxGeometry(1, 1, 1);
let material = new THREE.MeshBasicMaterial({ color: 0xffffff });
let cube = new THREE.Mesh(geometry, material);
console.log(cube)
scene.add(cube);


// 渲染循环
function render() {
    // 以每秒60次的频率绘制场景
    requestAnimationFrame(render);
    renderer.render(scene, camera);
    cube.rotation.y -= 0.05;
}
render();
